package com.camel.system.controller;


import com.camel.core.controller.BaseCommonController;
import com.camel.core.entity.Result;
import com.camel.core.enums.SysLogType;
import com.camel.core.model.SysLog;
import com.camel.core.service.BaseCommonService;
import com.camel.system.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <日志管理>
 *
 * @author baily
 * @date 2019/7/5
 * @since 1.0
 **/
@RestController
@RequestMapping(("/sysLog"))
public class SysLogController extends BaseCommonController<SysLog> {

    @Autowired
    private SysLogService<SysLog> service;

    @Override
    public Result save(@RequestBody SysLog entity) {
        entity.setLogType(SysLogType.getEnumByValue(entity.getLogTypeId()));
        return super.save(entity);
    }

    @Override
    public BaseCommonService<SysLog> getiService() {
        return service;
    }

    @Override
    public String getMouduleName() {
        return "日志";
    }
}

